<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="${createLinkTo(dir:'css',file:'main.css')}" />
    <link rel="shortcut icon" href="${createLinkTo(dir:'images',file:'favicon.ico')}" type="image/x-icon" />
    <title>Mobile Dashboard</title>
  </head>
  <body>
    <table>
        <tr>
            <td>
                <h1>${plan.name}</h1>
            </td>
            <td>
                <div align="right">
                    <g:formatDate format="yyyy-MM-dd(E)" date="${currentDate}"/><br/>
                    <g:formatDate format="a hh:mm:ss" date="${currentDate}"/><br/>
                    <!--Sunny-->
                </div>
            </td>
        </tr>
    </table>
    <div class="list">
        <table>
            <thead>
                <tr>
                    <th width="80px">Picture</th>
                    <th>Place</th>
                </tr>
            </thead>
            <tbody>
              <g:each in="${plan.items}" var="planItem">
              <g:if test="${planItem.date.getYear()==currentDate.getYear() && planItem.date.getMonth()==currentDate.getMonth() && planItem.date.getDate()==currentDate.getDate()}">
               <tr>
                  <td>
                    <img src="${createLinkTo(dir:'images',file:planItem.place.name+".jpg")}" alt="${planItem.place.name}" width="80px"/>
                  </td>
                  <td>
                    <g:link controller="planItem" action="show" id="${planItem.id}">
                        <h1>${planItem.place.name}</h1>
                        ${planItem.date}
                          <!--3km, 10 mins-->
                    </g:link>
                  </td>
                </tr>
              </g:if>
              </g:each>
            </tbody>
        </table>
    </div>
    <table border="1">
        <tr>
            <td style="width:33%;text-align:center">
                <g:link action="totalPlan" id="${plan.id}">
                    All plan items
                </g:link>
            </td>
            <td style="width:33%;text-align:center">
                &nbsp;
            </td>
            <td style="width:33%;text-align:center">
                <g:link action="planList">
                    Plan list
                </g:link>
            </td>
        </tr>
    </table>
    <table border="1">
        <tr height="50px">
            <td style="font-size:12pt; vertical-align:middle; text-align:center; width:33%;">
              <g:link url="http://finance.yahoo.com/currency-converter?u#from=USD;to=KRW;amt=1">
                Currency
              </g:link>
            </td>
            <td style="font-size:12pt; vertical-align:middle; text-align:center; width:33%;">
              <g:link url="http://translate.google.com/translate_t#">
                Translate
              </g:link>
            </td>
            <td style="font-size:12pt; vertical-align:middle; text-align:center; width:33%;">
              <g:link controller="diary" action="list">
                Diary
              </g:link>
            </td>
        </tr>
        <tr height="50px">
            <td style="font-size:12pt; vertical-align:middle; text-align:center; width:33%;">
                Local Search
            </td>
            <td style="font-size:12pt; vertical-align:middle; text-align:center; width:33%;">
              <g:link url="http://weather.yahoo.com/">
                Weather
              </g:link>
            </td>
            <td style="font-size:12pt; vertical-align:middle; text-align:center; width:33%; background-color:red; color:white;">
                Emergency Call
            </td>
        </tr>
    </table>
  </body>
</html>
